---@class Table_AnimationItem
local Table_AnimationItem = BaseClass("Table_AnimationItem", IDataItem)

function Table_AnimationItem:__ctor()
	---@type number @唯一ID
	self.Id = 0
	---@type string @动画名称
	self.AinmName = ""
	---@type number @优先级
	self.Layer = 0
	---@type number @播放模式1(1一次 2循环)
	self.WrapMode = 0
	---@type number @播放模式2
	self.PlayMode = 0
	---@type number @播放模式3
	self.QueueMode = 0
	---@type number @速度
	self.Speed = 0
	---@type number @过渡时间
	self.TransitTime = 0
	---@type number @循环次数
	self.LoopTime = 0
	---@type number @循环结束动作
	self.LoopOverAnimId = 0
	---@type boolean @是否能被打断
	self.IsCanBreak = false
	---@type boolean @结束后是否回调
	self.IsCallEnd = false
	---@type number @结束后的下一动作
	self.NextAnimId = 0
	---@type number @动作音效
	self.SoundId = 0
end

function Table_AnimationItem:Load(reader)
	self.temp = reader:ReadShortString()
	self.Id = tonumber(self.temp)
	self.AinmName = reader:ReadString()
	self.temp = reader:ReadShortString()
	self.Layer = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.WrapMode = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.PlayMode = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.QueueMode = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.Speed = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.TransitTime = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.LoopTime = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.LoopOverAnimId = tonumber(self.temp)
	self.IsCanBreak = reader:ReadBool()
	self.IsCallEnd = reader:ReadBool()
	self.temp = reader:ReadShortString()
	self.NextAnimId = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.SoundId = tonumber(self.temp)
end

---@class Table_AnimationMgr : IDataMgr
local this = BaseClass("Table_AnimationMgr", IDataMgr)

function this:FileName()
	return "Txt/Animation.txt"
end

---@return Table_AnimationItem
function this:GetItemByKey(key)
	return self.super.GetItemByKey(self, key)
end

---@return Table_AnimationItem
function this:GetItemByIdx(idx)
	return self.super.GetItemByIdx(self, idx)
end

function this:Load(reader)
	local item = Table_AnimationItem()
	item:Load(reader)
	self.mItemDic[item.Id] = self.mDataCount
	table.insert(self.mItemList, item)
end

---@type Table_AnimationMgr
Table_AnimationMgr = this()